package cn.aloxc.custom;

import javax.crypto.spec.PSource;

import cn.aloxc.tianya.reader.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {
	private Context context = null;
	private ImageView image = null;
	private Integer[] resources = { R.drawable.p_10000, R.drawable.p_10001,
			R.drawable.p_10002, R.drawable.p_10003, R.drawable.p_10004,
			R.drawable.p_10005, R.drawable.p_10006, R.drawable.p_10007,
			R.drawable.p_10008, R.drawable.p_10009, R.drawable.p_10010,
			R.drawable.p_10011, R.drawable.p_10012, R.drawable.p_10013,
			R.drawable.p_10014, R.drawable.p_10015, R.drawable.p_10016,
			R.drawable.p_10017, R.drawable.p_10018, R.drawable.p_10019,
			R.drawable.p_10020, R.drawable.p_10021, R.drawable.p_10022,
			R.drawable.p_10023, R.drawable.p_10024, R.drawable.p_10025,
			R.drawable.p_10026, R.drawable.p_10027, R.drawable.p_10028,
			R.drawable.p_10029, R.drawable.p_10030, R.drawable.p_10031,
			R.drawable.p_10032, R.drawable.p_10033, R.drawable.p_10034,
			R.drawable.p_10035, R.drawable.p_10036, R.drawable.p_10037,
			R.drawable.p_10038, R.drawable.p_10039, R.drawable.p_10040,
			R.drawable.p_10041, R.drawable.p_10042, R.drawable.p_10043,
			R.drawable.p_10044, R.drawable.p_10045, R.drawable.p_10046,
			R.drawable.p_10047, R.drawable.p_10048, R.drawable.p_10049, };

	public ImageAdapter(Context context) {
		this.context = context;
	}

	@Override
	public int getCount() {
		return resources.length;
	}

	@Override
	public Object getItem(int position) {
		return position;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		image = new ImageView(context);
		image.setImageResource(resources[position]);
		image.setAdjustViewBounds(true);
		image.setBackgroundResource(android.R.drawable.picture_frame);
		return image;
	}
	public Integer getcheckedImageIdPosition(int index){
		return resources[index];
	}
}
